package common;

import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.RandomUtil;
import com.aventrix.jnanoid.jnanoid.NanoIdUtils;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Calendar;
import java.util.Date;
import java.util.TimeZone;

@SpringBootTest(classes = test01.class)
public class test01 {

//    @Autowired
//    RedisTemplate redisTemplate;

    @Test
    public void test001(){
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
        Calendar calendar = Calendar.getInstance();
        //设置时区
        calendar.setTimeZone(TimeZone.getTimeZone("GMT+:08:00"));
        System.out.println(dateFormat.format(new Date()));
        //设置超时时间
        calendar.add(Calendar.MINUTE,10);
        Date outDate=calendar.getTime();
        System.out.println(dateFormat.format(outDate));
    }

    @Test
    public void test002(){
        System.out.println(LocalDateTime.now().format(DateTimeFormatter.BASIC_ISO_DATE));

        System.out.println(RandomUtil.randomNumbers(8));

        System.out.println(IdUtil.fastSimpleUUID());
    }

    @Test
    public void test003(){
        String[] path = new String[2];
        path[0] = "public";
        path[1] = "f3";
//        String collect = String.join("/", null);
//        System.out.println(collect);
    }

    @Test
    public void test004(){
        System.out.println();
//        System.out.println(UUID.randomUUID());
    }
}
